//新鲜好物 good
const data = [
  {
    src: './uploads/goods1.png',
    title: 'KN95级莫兰迪色防护口罩',
    num: 79
  },
  {
    src: './uploads/goods2.png',
    title: '紫檀外独板三层普洱茶盒',
    num: 566
  },
  {
    src: './uploads/goods3.png',
    title: '法拉蒙高颜值记事本可定制',
    num: 58
  },
  {
    src: './uploads/goods4.png',
    title: '科技布布艺沙发',
    num: 3579
  },
]
const ul = document.querySelector('.good .content ul')
for (let i = 0; i < data.length; i++) {
  const li = document.createElement('li')
  li.innerHTML = ` <a href="#">
  <div class="pic"><img src=${data[i].src} alt=""></div>
  <div class="txt">
    <h3>${data[i].title}</h3>
    <p>¥<span>${data[i].num}</span></p>
  </div>
</a>`
  ul.appendChild(li)

}

// const div = document.querySelectorAll('.good .content .pic img')
// const txt = document.querySelectorAll('.good .content .txt h3')
// const num = document.querySelectorAll('.good .content .txt span')
// // console.log(div)
// for (let i = 0; i < data.length; i++) {
//   // console.log(div[i].src);
//   div[i].src = data[i].src
//   // console.log(txt[i].innerHTML);
//   // console.log(data[i].title);
//   txt[i].innerHTML = data[i].title
//   num[i].innerHTML = data[i].num
// }


// 人气推荐
const dataSet = [
  {
    src: './uploads/recommend1.png',
    title: '特惠推荐',
    num: '我猜得到 你的需要'
  },
  {
    src: './uploads/recommend2.png',
    title: '爆款推荐',
    num: '爆款推荐'
  },
  {
    src: './uploads/recommend3.png',
    title: '爆款推荐',
    num: '编辑尽心整理推荐'
  },
  {
    src: './uploads/recommend4.png',
    title: '鲜花园艺',
    num: '给生活增加仪式感'
  },
]
const ulr = document.querySelector('.recommond .content ul')
for (let i = 0; i < dataSet.length; i++) {
  const li = document.createElement('li')
  li.innerHTML = ` <li>
  <a href="#">
    <div class="pic"><img src=${dataSet[i].src} alt=""></div>
    <div class="txt">
      <h3>${dataSet[i].title}</h3>
      <p>${dataSet[i].num}</p>
    </div>
  </a>
</li>`
  ulr.appendChild(li)
}


// const div2 = document.querySelectorAll('.recommond .content .pic img')
// const txt2 = document.querySelectorAll('.recommond .content .txt h3')
// const num2 = document.querySelectorAll('.recommond .content .txt p')
// for (let i = 0; i < dataSet.length; i++) {
//   // console.log(div[i].src);
//   div2[i].src = dataSet[i].src
//   // console.log(txt[i].innerHTML);
//   // console.log(data[i].title);
//   txt2[i].innerHTML = dataSet[i].title
//   num2[i].innerHTML = dataSet[i].num
// }
